<template>
     <!--轮播图-->
        
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide" v-for="item in lunboList">
                        <a :href="item.url">
                            <div>
                                <img v-bind:src="item.imageUrl" alt="">
                            </div>
                        </a>
                    </div>
                </div>
            </div>
         
</template>
<script>
import $ from 'jquery';
import Swiper from 'swiper';
export default {   
    data: function() {
                return {
                    lunboList:[]
                }
    },
    mounted:function(){
        var url = 'http://localhost:3000/lunbo?time='+ new Date().getTime();
        var that = this;
            $.get(url, function(res) {
                that.lunboList = res.data.billboards;
                 that.$nextTick(function() {
                    new Swiper('.swiper-container', {
                        loop: true,
                        autoplay: 1000,
                        autoplayDisableOnInteraction: false
                    })
                 })
            })
    }
}
</script>